﻿@using Mvc2Ng.Web.UI.Areas.EasyAuthorPortal.Extensions
@model NewMessage
<section class="mainbar" data-ng-controller="messagecenter as vm">
  <section class="matter">
    <div class="container">
      <div class="row">
        <div class="widget wviolet">
          <div data-cc-widget-header title="{{vm.title}}"></div>
          <div class="widget-content user">
            <h3>Messages</h3>
            <div class="btn-group pull-right">
              <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                New <span class="caret"></span>
              </button>
              <ul class="dropdown-menu" role="menu">
                <li><a data-ng-href="#">Mail (private to receiver)</a></li>
                <li><a data-ng-href="#">Chat (direct and non-persistent)</a></li>
                <li><a data-ng-href="#">Discussion (public to team)</a></li>
              </ul>
            </div>
          </div>
        </div>
        <div class="widget-foot">
          {{vm.messageCount}} Messages total
          <div class="clearfix"></div>
        </div>
      </div>
      <div class="pull-right span5">
        <div class="widget wgreen">
          <div data-cc-widget-header title="Create Message" data-allow-collapse="false"></div>
          <div class="widget-content text-center text-info">
            <small>Add a message to a peer</small>
          </div>
          <div class="btn-group">
            <button type="button" class="btn btn-primary">Add Receiver</button>
          </div>
          <form>
            @Html.AngularEditorForModel()
          </form>
          <div class="widget-foot">
            <div class="btn-group pull-left">
              <button type="button" class="btn btn-danger">Cancel</button>
            </div>
            <div class="btn-group pull-right">
              <button type="button" class="btn btn-primary ">Send Message</button>
            </div>
            <div class="clearfix"></div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="span5">
          <div class="widget wviolet">
            <div data-cc-widget-header title="Recent Messages" data-allow-collapse="true"></div>
            <div class="widget-content text-center text-info">
              <table class="table table-condensed table-striped">
                <tbody>
                  <tr data-ng-repeat="m in vm.messages">
                    <td>{{m.subjectIcon}}</td>
                    <td>{{m.senderIcon}}</td>
                    <td>
                      <strong>{{m.subject}}</strong>
                      {{m.senderNames}}
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="widget-foot">
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
      </div>

    </div>
  </section>
</section>
